-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(world): prevent initialising the world multiple times [L-05] #2170
Conversation
🦋 Changeset detectedLatest commit: 78336aa The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
packages/world/src/World.sol
Outdated
revert World_AlreadyInitialized(); | ||
} | ||
|
||
WorldInitialized.set(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we store the core module's address here? Almost the same cost (since it's one storage write) but might be interesting to know which core module was used to init the world
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that seems like a reasonable thing to keep around. It kind of "enshrines" the core module differently to the other modules, but we are already writing to storage for it.
Co-authored-by: alvarius <[email protected]>
Co-authored-by: alvarius <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! 🚢
Prevents the world from being initialised multiple times. Pulled out from #2168